package com.github.llyb120.szuniver.config;

/**
 * @Author: Administrator
 * @Date: 2020/9/16 11:15
 */
public class Result {
    public boolean success = false;
    public String errMessage = "";
    public Object data;
    public long timestamp = System.currentTimeMillis();


    public static Result ok(Object data){
        Result ret = new Result();
        ret.success = true;
        ret.data = data;
        return ret;
    }

    public static Result ok(){
        return ok(null);
    }

    public static Result fail(){
        return fail(null);
    }

    public static Result fail(String msg){
        Result ret = new Result();
        ret.success = false;
        ret.data = null;
        ret.errMessage = msg;
        return ret;
    }
}